/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: nu uc
 * License Type: Evaluation
 */
package org.testis.orm.classes;

import org.orm.*;
import org.hibernate.Query;
import java.util.List;

public class T_bed_networkadaptertypeFactory {
    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByORMID(
	    int id) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return loadT_bed_networkadaptertypeByORMID(session, id);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype getT_bed_networkadaptertypeByORMID(
	    int id) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return getT_bed_networkadaptertypeByORMID(session, id);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByORMID(
	    int id, org.hibernate.LockMode lockMode) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return loadT_bed_networkadaptertypeByORMID(session, id, lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype getT_bed_networkadaptertypeByORMID(
	    int id, org.hibernate.LockMode lockMode) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return getT_bed_networkadaptertypeByORMID(session, id, lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByORMID(
	    PersistentSession session, int id) throws PersistentException {
	try {
	    return (T_bed_networkadaptertype) session
		    .load(org.testis.orm.classes.T_bed_networkadaptertype.class,
			    new Integer(id));
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype getT_bed_networkadaptertypeByORMID(
	    PersistentSession session, int id) throws PersistentException {
	try {
	    return (T_bed_networkadaptertype) session
		    .get(org.testis.orm.classes.T_bed_networkadaptertype.class,
			    new Integer(id));
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByORMID(
	    PersistentSession session, int id, org.hibernate.LockMode lockMode)
	    throws PersistentException {
	try {
	    return (T_bed_networkadaptertype) session
		    .load(org.testis.orm.classes.T_bed_networkadaptertype.class,
			    new Integer(id), lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype getT_bed_networkadaptertypeByORMID(
	    PersistentSession session, int id, org.hibernate.LockMode lockMode)
	    throws PersistentException {
	try {
	    return (T_bed_networkadaptertype) session
		    .get(org.testis.orm.classes.T_bed_networkadaptertype.class,
			    new Integer(id), lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype[] listT_bed_networkadaptertypeByQuery(
	    String condition, String orderBy) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return listT_bed_networkadaptertypeByQuery(session, condition,
		    orderBy);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype[] listT_bed_networkadaptertypeByQuery(
	    String condition, String orderBy, org.hibernate.LockMode lockMode)
	    throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return listT_bed_networkadaptertypeByQuery(session, condition,
		    orderBy, lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype[] listT_bed_networkadaptertypeByQuery(
	    PersistentSession session, String condition, String orderBy)
	    throws PersistentException {
	StringBuffer sb = new StringBuffer(
		"From org.testis.orm.classes.T_bed_networkadaptertype as T_bed_networkadaptertype");
	if (condition != null)
	    sb.append(" Where ").append(condition);
	if (orderBy != null)
	    sb.append(" Order By ").append(orderBy);
	try {
	    Query query = session.createQuery(sb.toString());
	    List list = query.list();
	    return (T_bed_networkadaptertype[]) list
		    .toArray(new T_bed_networkadaptertype[list.size()]);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype[] listT_bed_networkadaptertypeByQuery(
	    PersistentSession session, String condition, String orderBy,
	    org.hibernate.LockMode lockMode) throws PersistentException {
	StringBuffer sb = new StringBuffer(
		"From org.testis.orm.classes.T_bed_networkadaptertype as T_bed_networkadaptertype");
	if (condition != null)
	    sb.append(" Where ").append(condition);
	if (orderBy != null)
	    sb.append(" Order By ").append(orderBy);
	try {
	    Query query = session.createQuery(sb.toString());
	    query.setLockMode("this", lockMode);
	    List list = query.list();
	    return (T_bed_networkadaptertype[]) list
		    .toArray(new T_bed_networkadaptertype[list.size()]);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByQuery(
	    String condition, String orderBy) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return loadT_bed_networkadaptertypeByQuery(session, condition,
		    orderBy);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByQuery(
	    String condition, String orderBy, org.hibernate.LockMode lockMode)
	    throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return loadT_bed_networkadaptertypeByQuery(session, condition,
		    orderBy, lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByQuery(
	    PersistentSession session, String condition, String orderBy)
	    throws PersistentException {
	T_bed_networkadaptertype[] t_bed_networkadaptertypes = listT_bed_networkadaptertypeByQuery(
		session, condition, orderBy);
	if (t_bed_networkadaptertypes != null
		&& t_bed_networkadaptertypes.length > 0)
	    return t_bed_networkadaptertypes[0];
	else
	    return null;
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByQuery(
	    PersistentSession session, String condition, String orderBy,
	    org.hibernate.LockMode lockMode) throws PersistentException {
	T_bed_networkadaptertype[] t_bed_networkadaptertypes = listT_bed_networkadaptertypeByQuery(
		session, condition, orderBy, lockMode);
	if (t_bed_networkadaptertypes != null
		&& t_bed_networkadaptertypes.length > 0)
	    return t_bed_networkadaptertypes[0];
	else
	    return null;
    }

    public static java.util.Iterator iterateT_bed_networkadaptertypeByQuery(
	    String condition, String orderBy) throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return iterateT_bed_networkadaptertypeByQuery(session, condition,
		    orderBy);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static java.util.Iterator iterateT_bed_networkadaptertypeByQuery(
	    String condition, String orderBy, org.hibernate.LockMode lockMode)
	    throws PersistentException {
	try {
	    PersistentSession session = org.testis.orm.manager.TestisDbPersistentManager
		    .instance().getSession();
	    return iterateT_bed_networkadaptertypeByQuery(session, condition,
		    orderBy, lockMode);
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static java.util.Iterator iterateT_bed_networkadaptertypeByQuery(
	    PersistentSession session, String condition, String orderBy)
	    throws PersistentException {
	StringBuffer sb = new StringBuffer(
		"From org.testis.orm.classes.T_bed_networkadaptertype as T_bed_networkadaptertype");
	if (condition != null)
	    sb.append(" Where ").append(condition);
	if (orderBy != null)
	    sb.append(" Order By ").append(orderBy);
	try {
	    Query query = session.createQuery(sb.toString());
	    return query.iterate();
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static java.util.Iterator iterateT_bed_networkadaptertypeByQuery(
	    PersistentSession session, String condition, String orderBy,
	    org.hibernate.LockMode lockMode) throws PersistentException {
	StringBuffer sb = new StringBuffer(
		"From org.testis.orm.classes.T_bed_networkadaptertype as T_bed_networkadaptertype");
	if (condition != null)
	    sb.append(" Where ").append(condition);
	if (orderBy != null)
	    sb.append(" Order By ").append(orderBy);
	try {
	    Query query = session.createQuery(sb.toString());
	    query.setLockMode("this", lockMode);
	    return query.iterate();
	} catch (Exception e) {
	    e.printStackTrace();
	    throw new PersistentException(e);
	}
    }

    public static T_bed_networkadaptertype createT_bed_networkadaptertype() {
	return new org.testis.orm.classes.T_bed_networkadaptertype();
    }

    public static T_bed_networkadaptertype loadT_bed_networkadaptertypeByCriteria(
	    T_bed_networkadaptertypeCriteria t_bed_networkadaptertypeCriteria) {
	T_bed_networkadaptertype[] t_bed_networkadaptertypes = listT_bed_networkadaptertypeByCriteria(t_bed_networkadaptertypeCriteria);
	if (t_bed_networkadaptertypes == null
		|| t_bed_networkadaptertypes.length == 0) {
	    return null;
	}
	return t_bed_networkadaptertypes[0];
    }

    public static T_bed_networkadaptertype[] listT_bed_networkadaptertypeByCriteria(
	    T_bed_networkadaptertypeCriteria t_bed_networkadaptertypeCriteria) {
	return t_bed_networkadaptertypeCriteria.listT_bed_networkadaptertype();
    }
}
